package com.wpam.scrabble.mobile.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.wpam.scrabble.mobile.R;
import com.wpam.scrabble.mobile.communication.CommunicationManager;

public class GameJoinActivity extends Activity implements OnClickListener {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_game_join);

		CommunicationManager.getInstance(this);
        Button btSearch = (Button) findViewById(R.id.bt_server_search);
        Button webSearch = (Button) findViewById(R.id.web_server_search);
        btSearch.setOnClickListener(this);
        webSearch.setOnClickListener(this);
    }

	public void onClick(View v) {
		Bundle b = new Bundle();
		switch (v.getId()) {
			case R.id.bt_server_search:
				b.putString("serverType", "BT");
				break;
			case R.id.web_server_search:
				b.putString("serverType", "WEB");
				break;
		}
		Intent btServerIntent = new Intent(this, ServerSearchActivity.class);
		btServerIntent.putExtras(b);
		startActivity(btServerIntent);
		finish();
	}
}
